package com.sita.tboard.hitchhike.search;

import com.sita.tboard.hitchhike.bean.SelectedAddress;

import java.util.HashMap;

/**
 * Created by xiaodong on 16/3/30.
 */
public class PoiSearchResultContainer {
    private static class PoiSearchResultContainerHolder {
        private static PoiSearchResultContainer INSTANCE = new PoiSearchResultContainer();
    }

    private PoiSearchResultContainer() {
    }

    public static PoiSearchResultContainer getInstance() {
        return PoiSearchResultContainerHolder.INSTANCE;
    }

    private HashMap<Boolean, SelectedAddress> poiItemMap = new HashMap<Boolean, SelectedAddress>();

    public void setResult(Boolean isFrom, SelectedAddress selectedAddress){
        poiItemMap.put(isFrom, selectedAddress);
    }

    public SelectedAddress getResult(Boolean isFrom){
        return poiItemMap.remove(isFrom);
    }
}
